package com.wm.banking;

import java.util.Scanner;

public class Account {
    private double balance = 10000;
    Scanner input = new Scanner(System.in);

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public void deposit(){
       Scanner input=new Scanner(System.in);
       System.out.print("请输入存款金额:");
       double deposit=input.nextDouble();
       System.out.println("你存入的金额是:"+deposit);
       System.out.println("您的余额为:"+(this.balance+deposit));
   }
    public void withDraw() {
        Scanner input = new Scanner(System.in);
        System.out.print("请输入取款金额:");
        double withDrow = input.nextDouble();
        if (balance >= withDrow) {
            System.out.println("您取出的金额是:" + withDrow);
            System.out.println("您的余额为:" + (this.balance - withDrow));
        } else {
            System.out.println("对不起，您的余额不足!");
        }
    }

    public static void main(String[] args) {
        Account account=new Account();
        account.deposit();
        account.withDraw();
    }

}
